import { Injectable } from "@nestjs/common";

@Injectable()
export class ThrottlerBehindProxyGuard {
  constructor() {}

  protected async getTracker(req: Record<string, any>, res: any): Promise<any> {
    return req.ips.length ? req.ips[0] : req.ip; // individualize IP extraction to meet your own needs
    // return {
    //   ip: req.ip,
    //   user: req.user,
    //   route: req.route.path,
    //   method: req.method,
    //   headers: req.headers,
    //   body: req.body,
    //   query: req.query,
    //   params: req.params,
    //   cookies: req.cookies,
    //   session: req.session,
    //   sessionID: req.sessionID,
    //   ipForwarded: req.ipForwarded,
    //   ipRange: req.ipRange,
    //   ipRangeSubnet: req.ipRangeSubnet,
    //   ipRangeNetmask: req.ipRangeNetmask,
    //   ipRangeNetwork: req.ipRangeNetwork,
    //   ipRangeBroadcast: req.ipRangeBroadcast,
    //   ipRangeFirst: req.ipRangeFirst,
    //   ipRangeLast: req.ipRangeLast,
    //   ipRangeSize: req.ipRangeSize,
    //   ipRangeBitmask: req.ipRangeBitmask,
    //   ipRangeBitmaskNetwork: req.ipRangeBitmaskNetwork,
    //   ipRangeBitmaskBroadcast: req.ipRangeBitmaskBroadcast,
    //   ipRangeBitmaskFirst: req.ipRangeBitmaskFirst,
    //   ipRangeBitmaskLast: req.ipRangeBitmaskLast,
    //   ipRangeBitmaskSize: req.ipRangeBitmaskSize,
    //   ipRangeBitmaskNetworkSize: req
    // };
  }
}